﻿using EntityFramework.Entity.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using YouTravel.DomainModels;

namespace Repositories.Configuration
{
    public class PaymentEntrustMap : EntityConfigurationBase<PaymentEntrust>
    {
        public PaymentEntrustMap()
        {
            this.Property(p => p.BankNumber).HasMaxLength(20).IsRequired();
            this.Property(p => p.CollectionBank).HasMaxLength(30).IsRequired();
            this.Property(p => p.Payee).HasMaxLength(20).IsRequired();

            this.HasRequired(p => p.Payment).WithMany(m => m.PaymentEntrust).HasForeignKey(f => f.PaymentId);
            this.HasMany(p => p.Attachments).WithOptional();
        }
    }
}
